<%include("/common/list-top.html",{title:"容器管理",css:[ctxPath+"/zui/dist/lib/uploader/zui.uploader.min.css",ctxPath +
"/layer/skin/default/layer.css",ctxPath+"/css/basice.css",ctxPath+"/css/containerManage-list.css"]}){}
%>

<div class="container-fluid">
    <div class="page-head-nav">
        <div class="row">
            <div class="col-xs-10">
                <ol class="breadcrumb">
                    <li><a href="${ctxPath}"><i class="icon icon-home"></i>工作台</a></li>
					<li>基础数据管理</li>
					<li><a href="${ctxPath}/container">容器</a></li>
				</ol>
			</div>
			<div class="btn-group col-xs-2">
				 <a class="btn btn-link" type="button" id="addButton">新增</a>
				 <a class="btn btn-link" target="_blank" type="button" href="http://120.25.225.145:8080/808gps/index.html?account=clienttest&password=123456&clientLogin=2&lang=zh" id="monitoring"><i class="icon icon-globe"></i> 实时监控</a>
			</div>
        </div>
    </div>
    <!-- 接受并保存图片url -->
	<input type="hidden"  id="imageUrl"  value="${imageUrl!}">

<div class="row">
	<!--数据表格 -->
	<div class="col-xs-12">
		<div class="row listui" id="mainUI">
			<div class="col-xs-12 ">
				<#listTable url="/bartalks/container"
					fields="container_code,容器编码,no-sort,no-query|container_name,容器名称,no-sort,no-query|container_type,容器类型,7%,no-sort,no-query|longs,长(cm),7%,no-sort,query|wide,宽(cm),7%,no-sort,query|high,高(cm),7%,no-sort,query|dead_weight,自重(kg),8%,no-sort,query|bear_weight,承重(kg),8%,no-sort,query|permission,容器许可,no-sort,query|qrcode,二维码,5.5%,no-sort,query" />
			</div>
		</div>
	</div>
</div>

<!-- 新增 -->
<div class="modal fade" id="addWindow">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
        <h4 class="modal-title">新增</h4>
      </div>
      <div class="modal-body">
		<form class="form-horizontal" id="addForm">
        <div class="row">
            <div class="col-xs-1">容器编码</div>
            <div class="col-xs-3"><input class="form-control" name="containerCode" id="add_containerCode"  readonly /></div>
            <div class="col-xs-1">容器名称</div>
            <div class="col-xs-3"><input class="form-control" name="containerName" id="add_containerName"  /></div>
            <div class="col-xs-1">容器模板</div>
            <div class="col-xs-3">
                <select id="vesselTemplates1" name="templateCode" class="form-control">
                    <option selected="selected" value = "0">---请选择模版---</option>
                    <% for ( btTempalte in session.btTempalteList! ) { %>
							  		<option value = "${btTempalte.templateCode!}" >${btTempalte.templateCode!}(${btTempalte.templateName!} ${btTempalte.longs!}cm长  ${btTempalte.wide!}cm宽)</option>
							  <%}%>
                </select>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-1">自重(kg)</div>
            <div class="col-xs-3"><input class="form-control number" name="deadWeight" id="add_deadWeight" /></div>
            <div class="col-xs-1">承重(kg)</div>
            <div class="col-xs-3"><input class="form-control number" name="bearWeight" id="add_bearWeight" /></div>
             <div class="col-xs-1">容器类型</div>
            <div class="col-xs-3">
            <select id="add_containerType" name="containerType" class="form-control">
								<option value="-1" selected="selected">---请选择容器类型---</option>
								<option value="0">仓储容器</option>
								<option value="1">运输容器</option>
								</select>
            </div>
        </div>
        
        <div class="row">
            <div class="col-xs-1">长度(cm)</div>
            <div class="col-xs-3"><input class="form-control number" name="longs" id="add_longs" /></div>
            <div class="col-xs-1">宽度(cm)</div>
            <div class="col-xs-3"><input class="form-control number" name="wide" id="add_wide" /></div>
            <div class="col-xs-1">高度(cm)</div>
            <div class="col-xs-3"><input class="form-control number" name="high" id="add_high" /></div>
        </div>
    <div class="row">
     <div class="col-xs-1">容器许可</div>
     <div class="col-xs-3"><input class="form-control"  name="permission" id="add_permission" /></div>
     <div class="col-xs-1">二维码</div>
     <div class="col-xs-3"><input class="form-control"  name="qrcode" id="add_qrcode" placeholder="请填写二维码信息,否则启动默认二维码"/></div>
    </div>
    
        <div class="row">
            <div class="col-xs-1">容器图片</div>
            <div class="col-xs-11">
               <div id='uploaderExample1' class="uploader">
                <input type="hidden" name="containerUrl" id="add_containerUrl">
     <div class="file-list" data-drag-placeholder="请拖拽文件到此处"></div>
     <button type="button" class="btn btn-primary uploader-btn-browse"><i class="icon icon-cloud-upload"></i> 选择文件</button>
     <button type="button" data-toggle="tooltip" title="" class="btn btn-primary btn-link btn-delete-file"  id="deleteFile1"><i class="icon icon-trash text-danger"></i>删除</button>
  </div>
</div>
        </div>
        <div class="row">
            <div class="col-xs-1">附件图片</div>
            <div class="col-xs-11">
                <div id="uploaderExample2" class="uploader">
                <input type="hidden" name="attachmentUrl" id="add_attachmentUrl">
                   <div class="file-list" data-drag-placeholder="请拖拽文件到此处"></div>
   <button type="button" class="btn btn-primary uploader-btn-browse"><i class="icon icon-cloud-upload"></i> 选择文件</button>
  <button type="button" data-toggle="tooltip" title="" class="btn btn-primary btn-link btn-delete-file"  id="deleteFile2"><i class="icon icon-trash text-danger"></i>删除</button>
  </div>
                </div>
            </div>
        <div class="row">
            <div class="col-xs-1">备注</div>
            <div class="col-xs-11">
                <textarea class="form-control" name="comment" id=add_comment></textarea>
            </div>
        </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" id="add">保存</button>
      </div>
    </div>
  </div>
</div>

<!-- 编辑 -->
<div class="modal fade" id="editWindow">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
        <h4 class="modal-title">编辑</h4>
      </div>
      <div class="modal-body">
      		<form class="form-horizontal" id="editForm">
        <div class="row">
        <input type="hidden" id="id" name="id">
        <input type="hidden" id="edit-companyId" name="companyId">
            <div class="col-xs-1">容器编码</div>
            <div class="col-xs-3"><input class="form-control" name="containerCode" id="edit-containerCode"  readonly="readonly"/></div>
            <div class="col-xs-1">容器名称</div>
            <div class="col-xs-3"><input class="form-control" name="containerName" id="edit-containerName" /></div>
            <div class="col-xs-1">容器模板</div>
            <div class="col-xs-3">
                <select id="vesselTemplates2" name="templateCode" class="form-control">
                    <% for ( btTempalte in session.btTempalteList! ) { %>
							  		<option value = "${btTempalte.templateCode!}" >${btTempalte.templateCode!}(${btTempalte.templateName!} ${btTempalte.longs!}cm长  ${btTempalte.wide!}cm宽)</option>
							  <%}%>
                </select>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-1">长度(cm)</div>
            <div class="col-xs-3"><input class="form-control number" name="longs" id="edit-longs"  /></div>
            <div class="col-xs-1">宽度(cm)</div>
            <div class="col-xs-3"><input class="form-control number" name="wide" id="edit-wide"  /></div>
            <div class="col-xs-1">高度(cm)</div>
            <div class="col-xs-3"><input class="form-control number" name="high" id="edit-high"  /></div>
        </div>
        <div class="row">
           <div class="col-xs-1">自重(kg)</div>
            <div class="col-xs-3"><input class="form-control number" name="deadWeight" id="edit_deadWeight" /></div>
            <div class="col-xs-1">承重(kg)</div>
            <div class="col-xs-3"><input class="form-control number" name="bearWeight" id="edit_bearWeight" /></div>
              <div class="col-xs-1">容器类型</div>
            <div class="col-xs-3">
             <select id="edit-containerType" name="containerType" class="form-control">
								<option value="-1" selected="selected">---请选择容器类型---</option>
								<option value="0">仓储容器</option>
								<option value="1">运输容器</option>
								</select>
            </div>
        </div>
          <div class="row">
          <div class="col-xs-1">容器许可</div>
          <div class="col-xs-3"><input class="form-control" name="permission" id="edit-permission" placeholder=""/></div>
          <div class="col-xs-1">二维码</div>
          <div class="col-xs-3"><input class="form-control"  name="qrcode" id="edit_qrcode" placeholder="请填写二维码信息,否则启动默认二维码"/></div>
       </div>
        <div class="row">
            <div class="col-xs-1">容器图片</div>
            <div class="col-xs-11">
                <div id="uploaderExample3" class="uploader">
                 <input type="hidden" name="containerUrl" id="edit-containerUrl">
                    <div class="file-list"  id="showContainer"></div>
                    <button type="button" class="btn btn-primary uploader-btn-browse"><i class="icon icon-cloud-upload"></i> 选择文件</button>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-1">附件图片</div>
            <div class="col-xs-11">
                <div id="uploaderExample4" class="uploader">
                 <input type="hidden" name="attachmentUrl" id="edit-attachmentUrl">
                    <div class="file-list" id="showContainer1"></div>
                    <button type="button" class="btn btn-primary uploader-btn-browse"><i class="icon icon-cloud-upload"></i> 选择文件</button>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xs-1">备注</div>
            <div class="col-xs-11">
                <textarea class="form-control" name="comment" id="edit-comment"></textarea>
            </div>
        </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" id="edit">保存</button>
      </div>
    </div>
  </div>
</div>

	<!-- 容器二维码 -->
	<div class="modal fade" id="qrcodeModal" tabindex="-1" role="dialog" >
			<div class="modal-dialog modal-sm" >
				<div class="modal-content" >
					<div class="modal-header" >
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title">二维码</h4>
					</div>
					<div class="modal-body">
						<div id="code"></div>
					</div>
					 <div class="modal-footer">
					</div> 
				</div>
			</div>
	</div>

</div>
<%include("/common/list-bottom.html",{js:[ctxPath+"/ztree/js/jquery.ztree.all.min.js",
ctxPath+"/layer/layer.js",ctxPath+"/zui/dist/lib/uploader/zui.uploader.min.js",
ctxPath + "/js/jquery.qrcode.min.js",
ctxPath+"/js/basics/container-list.js"]}){} %>